package com.hu.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BlogPraiseMapper extends BaseMapper {
    @Insert("insert into blog_praise(blog_id,user_id) values (#{blogId},#{userId})")
    void setPraise(Integer blogId, Integer userId);

    @Select("select user_id from blog_praise where blog_id = #{blogId}")
    List<Integer> isPraise(@Param("blogId") Integer blogId);
}
